#ifndef IMPORTEXPORT_H_
#define IMPORTEXPORT_H_

#include "../Buddy.h"

#include <wx/string.h>
#include <wx/txtstrm.h>
#include <wx/datetime.h>

namespace Impp
{

class ImportExport
{
public:
	ImportExport();
	virtual ~ImportExport();

public:
	void exportBuddyHistory(Buddy* buddy, const wxString & file);
	void exportAllHistory(const wxString & file);

private:
	void writeXmlStart(wxTextOutputStream & out);
	void writeHistrory(wxTextOutputStream & out, Buddy* buddy,const wxDateTime & since);
	void writeMessage(wxTextOutputStream & out, const wxDateTime & time, const wxString & message, bool outgoing);
	void writeBuddyStart(wxTextOutputStream & out, Buddy* buddy);
	wxString toBooleanString(bool b);
	wxString escapeString(wxString str);

};

}

#endif /*IMPORTEXPORT_H_*/
